<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html
	class=" js flexbox flexboxlegacy canvas canvastext webgl no-touch geolocation postmessage no-websqldatabase indexeddb hashchange history draganddrop websockets rgba hsla multiplebgs backgroundsize borderimage borderradius boxshadow textshadow opacity cssanimations csscolumns cssgradients no-cssreflections csstransforms csstransforms3d csstransitions fontface generatedcontent video audio localstorage sessionstorage webworkers applicationcache svg inlinesvg no-smil svgclippaths">
<head>
<meta charset="UTF-8">
<title>部门和用户设置</title>

<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">

<link rel="stylesheet"
	href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
<!-- 引用Vue -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<link href="http://cdn.xtcrm.com/cdn//v7/pl/summernote/summernote.css"
	rel="stylesheet">
<link href="../../css/zcss/bootstrap-datepicker3.min.css"
	rel="stylesheet">
<link href="../../css/zcss/switchery.min.css" rel="stylesheet">
<link href="../../css/zcss/bootstrap-clockpicker.min.css"
	rel="stylesheet">
<link href="../../css/zcss/bootstrap-table.min.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/bootstrap.min.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/bootstrap-select.min.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/core.css" rel="stylesheet" type="text/css">
<link href="../../css/zcss/components.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/icons.css" rel="stylesheet" type="text/css">
<link href="../../css/zcss/pages.css" rel="stylesheet" type="text/css">
<link href="../../css/zcss/responsive.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/sweetalert.min.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/custombox.min.css" rel="stylesheet">
<link href="../../css/zcss/animate.min.css" rel="stylesheet"
	type="text/css">
<link href="../../css/zcss/css.css" rel="stylesheet" type="text/css">
<link href="../../customer/css/dept.css" rel="stylesheet"
	type="text/css" />
<link href="">
<!--图标的外部样式-->
<link href="http://cdn.xtcrm.com/cdn//v7/fm/ub/css/icons.css"
	rel="stylesheet" type="text/css">
<!--图标的外部样式-->
<!-- 引用Vue -->

<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<!-- 引入组件库 -->
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
<script type="text/javascript" src="js/jquery-3.1.0.js"></script>
<script type="text/javascript" src="js/axios.js"></script>
<script type="text/javascript" src="js/qs.js"></script>
<script type="text/javascript" src="js/jqp.js"></script>
<style type="text/css">
.span_node {
	margin-left: 100px;
	margin-top: 100px;
	border: 1px solid #ccc;
	display: none;
}

.custom-tree-node {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	font-size: 14px;
	padding-right: 8px;
}
</style>
</head>
<body class="widescreen fixed-left">
	<div class="enlarged forced" id="wrapper">
		<div class="content-page">
			<div class="content">
				<div class=" container-fluid">
					<h4>
						<i class="fa fa-users m-r-5"></i><strong>部门和用户设置</strong>
					</h4>
					<div class=" m-l-20" id="usercount">

<<<<<<< HEAD
						<div class="info">
								用户人数：
								<span style="font-size:30px">${usercount}</span>
								<font color="#999999">&nbsp;</font>已有部门：<span style="font-size: 30px">${deptcount}</span>
								已有角色：<span style='font-size:30px'>${rolecount}</span>								
							</div>

						<!--UTF8-->
					</div>
					<div class="card-box m-20" id="ptreeContainer">
						<div class="ptree-adjust-user-status-container">
							<div class="adjust-members"></div>
						</div>
						<div class="ptree-user-status-container"></div>
						<div class="savewarning text-center" style="display: none;"
							bindonetimesclick="1">
							<img align="AbsMiddle" src="/images/iconb/bigwarning.png"><span>提醒：<b>用户和部门结构变化，保存后生效！</b>
							</span><br>
							<button
								class="ptree-config-save btn btn-d btn-block btn-lg m-t-10">保存用户和部门结构</button>
						</div>
						<div id="app" @click="bigClick($event)" style="border: #ccc solid 1px; ">
							<el-row> 
							<br />
							<el-tree ref="tree" :data="treeList" :props="defaultProps"
								@node-click="handleNodeClick" default-expand-all
								node-key="dep_name" :check-strictly="true">
								
								<span id="spanbtu"  class="custom-tree-node" slot-scope="{ node, data }">
						<span>{{data.dep_name}} </span>				
        <span v-if="data.arslsl.use_id==null  ">
        <!-- && data.arslsl.dep_superid==7 -->
       <!--  <span v-if="data.arslsl.dep_superid==7 "> -->
        <el-button v-show="hows"
            type="text"
            size="mini"
            @click="addNode">
                    新建部门
          </el-button>
       <!--  </span> -->
          
           <el-button
            type="text"
            size="mini"
            @click="updatedept(data.dep_name)">
                 修改部门
          </el-button>
           <el-button
            type="text"
            size="mini"
            @click="deleteNode(data.dep_name)">
                 删除部门
          </el-button>
          <el-button
            type="text"
            size="mini"
             @click="centerDialogVisible4=true">
            新建角色
          </el-button>
          <el-button
            type="text"
            size="mini"
            @click="adduserse(data.dep_name)">
            添加用户
          </el-button>
        </span>
      </span>
							</el-tree> 
							 <el-dialog
								title="添加" :visible.sync="dialogVisible">
							<el-form :model="ruleForm" ref="ruleForm"> 
								<el-form-item label="父级部门"
								prop="supperdepName"> <el-input :disabled="true"
								v-model="ruleForm.supperdepName" style="width: 220px;color: #8c939d;"></el-input> </el-form-item> 
								
								
								<el-form-item label="部门名称"
								prop="depName"> <el-input placeholder="请输入部门名称"
								v-model="ruleForm.depName" style="width: 220px"></el-input> </el-form-item> 
								<span>
								<el-button @click="cancleSaveNode"> 取消 </el-button> <el-button
									@click="submitForm('ruleForm')"> <!--  --> 确定 </el-button>
							</span> </el-form> </el-dialog> </el-row>
							<el-dialog title="用户详情" :visible.sync="centerDialogVisible2"
								width="900px" center> <iframe :src="FrameSrc"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
                            <el-dialog title="部门修改" :visible.sync="centerDialogVisible5"
								width="900px" center> <iframe :src="fromsrcset"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
							<el-dialog title="用户添加" :visible.sync="centerDialogVisible3"
								width="900px" center> <iframe :src="FrameSrcse"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
							
							<el-dialog title="添加角色"  :visible.sync="centerDialogVisible4" width="500px" height="200px" center>
							<iframe src="/addrole"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
							
						</div>

						<script type="text/javascript">
							var _treeNode={
									dep_id:0,
									dep_name:"",
									dep_superid:0
							    }
							    var app = new Vue({
							        el:'#app',
							        data:{
							            treeNode:_treeNode,
							            treeList:[],
							            trdeptnods:[],
							            FrameSrc:"",
							            FrameSrcse:"",
							            FrameSrcserole:"",
							            fromsrcset:"",
							            xmxsdd:"",
							            hows:true,
							            options:[],
							            treeListData:[], // 无层级结构部门数据
							            defaultProps:{
							               children: 'arslsl', 
							                label: 'dep_name'
							               /* label: 'categoryName'*/
							            },
							            
							            dialogVisible:false, // 对话框，默认不打开
							            centerDialogVisible2:false,
							            centerDialogVisible3:false,
							            centerDialogVisible4:false,
							            centerDialogVisible5:false,
							            api:{
							                treeDataList:"selectdept.do",   // 得到部门数据，无层级结构 GET
							                saveTreeNode:"/saveTreeNode.do",   // 得到部门数据，无层级结构 GET
							                deleteTreeNode:"/deleTreeNode.do",
							            },
							            ruleForm:{
							            	depName:"",
							            	supperdepName:"",
							            }     
							        },
							        methods: {							        	
							            cateListFunction: function () {
							               $.ajax({
							                    type: "post",
							                    url: "selectdept.do",
							                    success: function (result) {
							                        app.cateList = result;
							                        app.treeList=result;
							                    }, error: function (result) {
							                    	console.log("查收失败");
							                    }
							                });
							            },
							            // 点击部门名称触发的事件
							            handleNodeClick: function (data) {
							               if(null==data.arslsl.use_id){
							            	   this.ruleForm.supperdepName=data.dep_name; 
							               }else{
							            	   console.info(data);							                
								                 this.FrameSrc="/updateusers?id="+data.arslsl.use_id;
												this.centerDialogVisible2 = true; 
							               }
							            },
							            adduserse:function(data){
							            	this.FrameSrcse="/adduser?use="+data;
											this.centerDialogVisible3 = true;
							            },
							         /*    // 获得选中的部门的key
							            checkedKeys:function (data) {
							            	console.log(data);
							                alert(JSON.stringify(this.$refs.tree.setCheckedKeys(data)));
							                alert(this.$refs.tree.setCheckedKeys(data))
							            	alert(data.arslsl.dep_id)
							            }, */
							            // 添加部门查询所有部门的方法
							            addNode:function () {
							               // 查询所有部门数据无层级结构
							                app.getTreeNode();
							                app.dialogVisible=true;
							            },
							       
							            // 保存部门
							           submitForm(formName)  {							              
							            //验证方法
											this.$refs[formName].validate((valid) => {
												if(valid) {
													//post提交数据
													axios.post(app.api.saveTreeNode,
														//参数转换
														Qs.stringify(this.ruleForm, {
															arrayFormat: 'brackets'
														})
													).then(function(v) {
														app.$message({message: v.data.settype, type: 'success'});
														//location.reload();
														//app.dialogVisible=false;
														 window.location.replace("/dept");
													}).catch(function(e) {
														alert("出错了"+e);
													});
												} else {
													console.log('error submit!!');
													return false;
												}
											});
							            } ,
							            cancleSaveNode:function () {
							                app.dialogVisible=false;
							                app.treeNode.depSuperid=0;
							                app.treeNode.depName="";
							            },
							            // 下拉框选中事件
							            selectChange:function (val) {
							                // select控件的option绑定的值为部门的id,我们将值绑定在要添加的元素的父id
							                alert("得到部门类型"+val);
							            },
							            // 批量删除部门（若有子部门则不予删除）
							            deleteNode:function (val) {
							            	 alert(val);
							                  axios.post(this.api.deleteTreeNode,
							  	           			//参数转换
							  	           			Qs.stringify({val:val})
							  	           		//	params:
							  	           			//ajax请求成功的回调函数
							  	           			).then(function(v){
							  	            			console.log("回调成功，获取了服务器端返回的值v");
							  	           			//console.log(v);
							  	           		
							  	           		if(v.data.xm=="删除成功"){
							  	           		app.$message({message: v.data.xm, type: 'success'});
							  	           		window.location.reload();
							  	           		}else{
							  	           		app.$message({message: v.data.xm, type: 'warning'});
							  	           		}
							  	           	}).catch(function(){
							  	           		alert("出错了");
							  	           	});

							            },getTreeNode:function () {
							            	 console.info(this.api.treeDataList+"            this.api.treeDataList");
							                // 查询所有部门数据无层级结构
							                axios.post(this.api.treeDataList)
							                    .then(
							                        function(result){
							                            // vue给我们封装的得，我们所得到的数据在返回的对象的data属性里
							                            app.treeListData=result.data;
							                            app.treeList=result.data;
							                        });
							            },
							            updatedept:function(val){
							            	 alert(val);
							            	this.fromsrcset="/updatedpt?depName="+val;
							            	this.centerDialogVisible5=true;
							            }
							        },mounted(){
							        //	console.log(app.rolecount+"     r       "+app.deptcount+"     d    "+app.usercount);
=======
						<!-- <div class="info">
								用户许可：
								BEGIN intype
								<span style="font-size:30px">41</span>
								<font color="#999999">（不含离职用户）&nbsp;</font>已使用：<span style="font-size: 30px">17</span>
								END intype

								PC：<span style='f86 ont-size:20px'></span>&nbsp;&nbsp;&nbsp;&nbsp;<a class="btn btn-link waves-effect" target="_blank" href="/sys/usersetup/new/userchm.doc" class="op_newsoftdown_btn op_newwoftdown_bdbtn OP_LOG_BTN"> 用户管理上手指南</a>
								<font color="#999999">其中</font>&nbsp;PC·App：<span style="font-size:20px">17/31</span>&nbsp;&nbsp;&nbsp;&nbsp;App：<span style="font-size:20px">0/10</span> &nbsp;&nbsp;&nbsp;&nbsp;
							</div>
 -->
						<!--UTF8-->
					</div>
					<div class="card-box m-20" id="ptreeContainer">
						<div class="ptree-adjust-user-status-container">
							<div class="adjust-members"></div>
						</div>
						<div class="ptree-user-status-container"></div>
						<div class="savewarning text-center" style="display: none;"
							bindonetimesclick="1">
							<img align="AbsMiddle" src="/images/iconb/bigwarning.png"><span>提醒：<b>用户和部门结构变化，保存后生效！</b>
							</span><br>
							<button
								class="ptree-config-save btn btn-d btn-block btn-lg m-t-10">保存用户和部门结构</button>
						</div>
						<div id="app" @click="bigClick($event)" style="border: #ccc solid 1px; ">
							<el-row> 
							<br />
							<el-tree ref="tree" :data="treeList" :props="defaultProps"
								@node-click="handleNodeClick" default-expand-all
								node-key="dep_name" :check-strictly="true">
								
								<span id="spanbtu"  class="custom-tree-node" slot-scope="{ node, data }">
						<span>{{data.dep_name}} </span>			
						<span>{{data.arslsl.dep_id}}</span>						
        <span v-if="data.arslsl.use_id==null  ">
        <!-- && data.arslsl.dep_superid==7 -->
       <!--  <span v-if="data.arslsl.dep_superid==7 "> -->
        <el-button v-show="hows"
            type="text"
            size="mini"
            @click="addNode">
                    新建部门
          </el-button>
       <!--  </span> -->
          
           <el-button
            type="text"
            size="mini"
            @click="updatedept(data.dep_name)">
                 修改部门
          </el-button>
           <el-button
            type="text"
            size="mini"
            @click="deleteNode(data.dep_name)">
                 删除部门
          </el-button>
          <el-button
            type="text"
            size="mini"
             @click="centerDialogVisible4=true">
            新建角色
          </el-button>
          <el-button
            type="text"
            size="mini"
            @click="adduserse(data.dep_name)">
            添加用户
          </el-button>
           <!-- <el-button
            type="text"
            size="mini">
            添加修改部门
          </el-button> -->
        </span>
      </span>
							</el-tree> 
							 <el-dialog
								title="添加" :visible.sync="dialogVisible">
							<el-form :model="ruleForm" ref="ruleForm"> 
							<!-- <el-form-item
								label="部门父类型" prop="dep_id"> <el-select
								placeholder="请选择要添加部门的父部门" v-model="ruleForm.dep_id"
								@change="selectChange"> <el-option
								v-for="item in trdeptnods" :label="item.dep_name"
								:value="item.dep_id"></el-option> </el-select> </el-form-item>  -->
								 
								<el-form-item label="父级部门"
								prop="supperdepName"> <el-input :disabled="true"
								v-model="ruleForm.supperdepName" style="width: 220px;color: #8c939d;"></el-input> </el-form-item> 
								
								
								<el-form-item label="部门名称"
								prop="depName"> <el-input placeholder="请输入部门名称"
								v-model="ruleForm.depName" style="width: 220px"></el-input> </el-form-item> 
								<span>
								<el-button @click="cancleSaveNode"> 取消 </el-button> <el-button
									@click="submitForm('ruleForm')"> <!--  --> 确定 </el-button>
							</span> </el-form> </el-dialog> </el-row>
							<el-dialog title="用户详情" :visible.sync="centerDialogVisible2"
								width="900px" center> <iframe :src="FrameSrc"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
                            <el-dialog title="部门修改" :visible.sync="centerDialogVisible5"
								width="900px" center> <iframe :src="fromsrcset"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
							<el-dialog title="用户添加" :visible.sync="centerDialogVisible3"
								width="900px" center> <iframe :src="FrameSrcse"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
							
							<el-dialog title="添加角色"  :visible.sync="centerDialogVisible4" width="500px" height="200px" center>
							<iframe src="/addrole"
								width="100%" frameborder="0"
								onload="this.height=this.contentWindow.document.body.scrollHeight,this.width = this.contentWindow.document.body.scrollWidth"></iframe>
							</el-dialog>
							
						</div>

						<script type="text/javascript">
							var _treeNode={
									dep_id:0,
									dep_name:"",
									dep_superid:0
							    }
							    var app = new Vue({
							        el:'#app',
							        data:{
							            treeNode:_treeNode,
							            treeList:[],
							            trdeptnods:[],
							            FrameSrc:"",
							            FrameSrcse:"",
							            FrameSrcserole:"",
							            fromsrcset:"",
							            xmxsdd:"",
							            hows:true,
							            options:[],
							            treeListData:[], // 无层级结构部门数据
							            defaultProps:{
							               children: 'arslsl', 
							                label: 'dep_name'
							               /* label: 'categoryName'*/
							            },
							            dialogVisible:false, // 对话框，默认不打开
							            centerDialogVisible2:false,
							            centerDialogVisible3:false,
							            centerDialogVisible4:false,
							            centerDialogVisible5:false,
							            api:{
							                treeDataList:"selectdept.do",   // 得到部门数据，无层级结构 GET
							                saveTreeNode:"/saveTreeNode.do",   // 得到部门数据，无层级结构 GET
							                deleteTreeNode:"/deleTreeNode.do",
							            },
							            ruleForm:{
							            	depName:"",
							            	supperdepName:"",
							            }     
							        },
							        methods: {							        	
							            cateListFunction: function () {
							               $.ajax({
							                    type: "post",
							                    url: "selectdept.do",
							                    success: function (result) {
							                        app.cateList = result;
							                        app.treeList=result;
							                     //   alert(app.treeList+"    你怎么还不出来shdsddsdddsdd");
							                      //  console.info(app.treeList+"    shdsddsdddsdd"); 
							                      //  console.log(app.treeList+"    shdsddsdddsdd");
							                    }, error: function (result) {
							                    	console.log("查收失败");
							                    }
							                });
							            },
							            // 点击部门名称触发的事件
							            handleNodeClick: function (data) {
							               if(null==data.arslsl.use_id){
							            	 /*   alert(data.dep_name+"    你怎么还不出来shdsddsdddsdd");
							            	   alert(data.arslsl.dep_id+"    你怎么还不出来data.arslsl.use_id");*/
							            	   this.ruleForm.supperdepName=data.dep_name; 
							               }else{
							            	   console.info(data);							                
								                 this.FrameSrc="/updateusers?id="+data.arslsl.use_id;
												this.centerDialogVisible2 = true; 
							               }
							            },
							            adduserse:function(data){
							            	this.FrameSrcse="/adduser?use="+data;
											this.centerDialogVisible3 = true;
							            },
							            // 获得选中的部门的key
							            checkedKeys:function (data) {
							            	console.log(data);
							                alert(JSON.stringify(this.$refs.tree.setCheckedKeys(data)));
							                alert(this.$refs.tree.setCheckedKeys(data))
							            	alert(data.arslsl.dep_id)
							            },
							            // 添加部门查询所有部门的方法
							            addNode:function () {
							               // 查询所有部门数据无层级结构
							                app.getTreeNode();
							                app.dialogVisible=true;
							            },
							       
							            // 保存部门
							           submitForm(formName)  {							              
							            //验证方法
											this.$refs[formName].validate((valid) => {
												if(valid) {
													//post提交数据
													axios.post(app.api.saveTreeNode,
														//参数转换
														Qs.stringify(this.ruleForm, {
															arrayFormat: 'brackets'
														})
													).then(function(v) {
														app.$message({message: v.data.settype, type: 'success'});
														//location.reload();
														//app.dialogVisible=false;
														 window.location.replace("/dept");
													}).catch(function(e) {
														alert("出错了"+e);
													});
												} else {
													console.log('error submit!!');
													return false;
												}
											});
							            } ,
							            cancleSaveNode:function () {
							                app.dialogVisible=false;
							                app.treeNode.depSuperid=0;
							                app.treeNode.depName="";
							            },
							            // 下拉框选中事件
							            selectChange:function (val) {
							                // select控件的option绑定的值为部门的id,我们将值绑定在要添加的元素的父id
							                alert("得到部门类型"+val);
							            },
							            // 批量删除部门（若有子部门则不予删除）
							            deleteNode:function (val) {
							            	 alert(val);
							               // app.getTreeNode();
							           //    var str=[];
							             //  str =this.$refs.tree.getCheckedKeys();
							               // alert(str);
							                  /* if(str.length<=0){ // 因为vue返回的是选中的key的数组
							                	  // ，如果没有选择任何元素返回 "[]",这是两个元素，所以我们判断长度为2时，为空
							                      app.$message.error("请至少选择一个部门");
							                      return ;
							                  } */
							                  
							                  //console.info(app.treeList.dep_name+"    xxxxx急急急    app.treeList.arslsl")
							                  
							                  
							                   axios.post(this.api.deleteTreeNode,{val:val}).then(function (result) {
								                				 alert("sshshsls孙老师");
												                    app.$message({message: '删除成功', type: 'success'});
												                    app.getTreeNode();
												                    app.cateListFunction();
												                });
							                  
							                  
							                  axios.post(this.api.deleteTreeNode,
							  	           			//参数转换
							  	           			Qs.stringify({val:val})
							  	           		//	params:
							  	           			//ajax请求成功的回调函数
							  	           			).then(function(v){
							  	            			console.log("回调成功，获取了服务器端返回的值v");
							  	           			console.log(v);
							  	           		app.$message({message: v.data.xm, type: 'success'});
							                   // app.getTreeNode();
							                   // app.cateListFunction();
							                    window.location.reload();
							  	           	}).catch(function(){
							  	           		alert("出错了");
							  	           	});
							                  
							                 // console.info(app.treeList+"    急急急    app.treeList")
							               /*  for(var i in app.treeList.arslsl){
							                	for(var x in app.treeList[i].arslsl){
							                		 console.log(app.treeListData[x].dep_name+"    app.treeListData[i].dep_name");
							                		 if(val==app.treeListData[x].dep_name){
								                		 console.log(app.treeListData[x].arslsl+"    treeListDatasfs ");
								                		 if(app.treeListData[x].arslsl.length>0){
								                			 axios.post(this.api.deleteTreeNode,val).then(function (result) {
								                				 alert("sshshsls孙老师");
												                    app.$message({message: '删除成功', type: 'success'});
												                    app.getTreeNode();
												                    app.cateListFunction();
												                });
								                		 }else{
								                			 alert("sshshsls在");
								                			 app.$message.error("父部门不可被删除");
								                			 return;
								                		 }
								                	}
							                	}
							                	
							                	
							                } */
							                  /*  for(var j in app.treeListData.arslsl){
							                	   alert(app.treeListData[j].depSuperid+"   app.treeListData[j]"+"      "+str[i]);
							                       if(app.treeListData[j].depSuperid == str[i]){
							                           app.$message.error("父部门不可被删除");
							                           return;
							                       }else{
							                    	   axios.post(this.api.deleteTreeNode,str).then(function (result) {
										                    app.$message({message: '删除成功', type: 'success'});
										                    app.getTreeNode();
										                    app.cateListFunction();
										                });
							                       }
							                   } */
							               
							            },getTreeNode:function () {
							            	 console.info(this.api.treeDataList+"            this.api.treeDataList");
							                // 查询所有部门数据无层级结构
							                axios.post(this.api.treeDataList)
							                    .then(
							                        function(result){
							                            // vue给我们封装的得，我们所得到的数据在返回的对象的data属性里
							                            app.treeListData=result.data;
							                            app.treeList=result.data;
							                        });
							            },
							            updatedept:function(val){
							            	 alert(val);
							            	this.fromsrcset="/updatedpt?depName="+val;
							            	centerDialogVisible5=true;
							            }
							        },mounted(){
>>>>>>> refs/remotes/origin/产品
										//post提交数据
										axios.post("/usercontroner/selectdeptall",
											//参数转换
											Qs.stringify(this.ruleForm, {
												arrayFormat: 'brackets'
											})		
										).then(function(v) {
											app.trdeptnods= v.data;
											
										}).catch(function(e) {
											alert("出错了aaa"+e);
										});
										
							        },
							            created: function () {
							                this.getTreeNode();
							                this.cateListFunction();
							            }
							    });
							</script>
					</div>
					<div class="alert alert-success  m-20">
					
							<b>说明</b><br> 1. 用户分为老板<i class="fa fa-diamond text-danger "></i>和 普通（主管<i class="fa fa-star text-warning"></i> <i class="fa fa-star-o text-warning"></i> 、员工）。<br> 2. 点击新建部门，可新建下级部门，最多可支持二级部门。<br> 3. 点击新建角色可添加角色。<br> 4. 注意：每个部门只允许有一个主管。
						
						</div>

				</div>
			</div>
		</div>
	</div>
</body>


</html>